<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePrtPaymentTypeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('prt_payment_type', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('pid')->default(0)->comment("父级id");
            $table->integer('mch_id')->default(0)->comment("商户id");
            $table->string('pay_name', 50)->default('')->comment("支付名称");
            $table->tinyInteger('pay_type')->default(1)->comment('[支付类型] 1线上 2线下');
            $table->string('short_name', 50)->default('balance')->comment("[简称],见common.php配置");
            $table->string('logo', 255)->default('')->comment("图标");
            $table->tinyInteger('poundage_type')->default(1)->comment('[手续费方式] 1百分比 2固定值');
            $table->decimal("poundage")->default(0.00)->comment("手续费");
            $table->json("pay_config")->comment("支付配置")->nullable();
            $table->tinyInteger("client")->default(1)->comment("[适用终端] 1通用 2移动 3pc");
            $table->mediumInteger('sort')->default(0)->comment("排序")->nullable();

            $table->integer('created_at')->comment("创建时间")->nullable();
            $table->integer('updated_at')->comment("更新时间")->nullable();
            $table->integer('deleted_at')->default(null)->comment("删除时间")->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('prt_payment_type');
    }
}
